package com.appspot.moviesessions.infrastructure.persistence;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.appspot.moviesessions.model.Session;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public final class SessionRecord {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent 
	private Key movie;

	@Persistent
	private Date time;

	@Persistent
	private Key location;
	
	public SessionRecord() {
	}

	public SessionRecord(Key movieKey,Date time, Key locationKey) {
		this.movie = movieKey;
		this.time = time;
		this.location = locationKey;
	}
	
	public Key getMovie() {
		return movie;
	}

	public Date getTime() {
		return time;
	}
	
	public Key getLocation() {
	    return location;
    }

}